{% extends "layout.html" %}

{% block title %}Création Offre Vga {% endblock %}

{% block content %}
 <fieldset>
<form method="post" class="form-horizontal" >

	<div class="row">
	<div class="span11">
	<a href="ve-offre-fixe" class="btn btn btn-primary"><i class="icon-plus-sign icon-white"></i> Voir la liste </a>
	  <fieldset>
		<legend align="center">Nouvel Offre {{type}}</legend>
        <input name="type" type="hidden" value="{% if type=="vga num" %}vga/num{% else %}{{type}}{% endif %}"/>
	  </fieldset>
    </div>
    </div>
    {% if choix_offre ==""  %} 
    <div class="control-group">
		<label class="control-label" for="choix_offre">Offre de Base</label>
		<div class="controls">
		   <select name="choix_offre" size="1" onchange='submit()'/>
           	<option value="">Choississez...</option>
           {% for offre in offres %}
			  <option value="{{offre.id}}">{{offre.nom}}</option>
            {% endfor %}   
			</select>
		</div>
	  </div>
	 {% else %}
	 <!-- Première colonne -->
	<div class="span5">
    
	  <fieldset>
	
      <div class="control-group">
		<label class="control-label" for="code_article">Code Article </label>
        <div class="controls">
		<div class="input-prepend">
        <input name="id_ha" type="hidden" value="{{offre_choisie.0.id}}"/> 
		   <input name="code_article" type="text" value=""/> 
		</div>
	  </div>
	  </div>
      
	  <div class="control-group">
		<label class="control-label" for="nom">Nom </label>
        <div class="controls">
		<div class="input-prepend">
		   <input name="nom" type="text" value="" placeholder="{{offre_choisie.0.nom}}"/> 
           <input name="id_offre_ha" type="hidden" value="{{offre_choisie.0.id}}" placeholder="{{offre_choisie.0.id}}"/>
		</div>
	  </div>
	  </div>
{% if offre.type != 'xdsl' %}         
		<div class="control-group">
		<label class="control-label" for="temps_min">TEMPS</label>
        <div class="controls">
		<div class="input-prepend">
		   <input name="temps_min" type="text" value="{{offre_choisie.0.temps_min}}"/> 
		</div>
	  </div>
	  </div>
 {% endif %}
      
	   <div class="control-group">
		<label class="control-label" for="prix">Prix </label>
		 <div class="controls">
         <div class="input-prepend">
		   <input name="pv0m" type="text" value="" placeholder="Prix d'achat: {{offre_choisie.0.prix_ha}} €"/> 
		</div>
        </div>
	  </div>
	  
	  <div class="control-group">
		<label class="control-label" for="pv12m">Prix 12M</label>
		 <div class="controls">
         <div class="input-prepend">
		   <input name="pv12m" type="text" value=""/> 
		</div>
        </div>
	  </div>
	   <div class="control-group">
		<label class="control-label" for="pv24m">Prix 24M</label>
		 <div class="controls">
         <div class="input-prepend">
		   <input name="pv24m" type="text" value=""/> 
		</div>
        </div>
	  </div>
	  
	   <div class="control-group">
		<label class="control-label" for="pv36m">Prix 36M</label>
		 <div class="controls">
         <div class="input-prepend">
		   <input name="pv36m" type="text" value=""/> 
		</div>
        </div>
        </div>
	  <div class="control-group">
		<label class="control-label" for="pv48m">Prix 48M</label>
		 <div class="controls">
         <div class="input-prepend">
		   <input name="pv48m" type="text" value=""/> 
		</div>
        </div>
        </div>
        
{% if type != 'xdsl' %}   	  
	<div class="control-group">
			<label class="control-label" for="horaires">Horaires</label>
			<div class="controls">
			   <select name="horaires" size="1" />
	           	<option value="">Selectionnez...</option>
				  <option value="24/24" {% if offre_choisie.0.horaires == "24/24" %}selected{% endif %}>24h sur 24</option>
				  <option value="8/19" {% if offre_choisie.0.horaires == "8/19" %}selected{% endif %}>8h à  19h</option>
	              <option value=""> </option>
	
				</select>
			</div>
		  </div>
          	
	      <div class="control-group">
			<label class="control-label" for="jours">Jours</label>
		<div class="controls">
			   <select name="jours" size="1" />
	           	<option value="">Selectionnez...</option>
				  <option value="7/7" {% if offre_choisie.0.jours == "7/7" %}selected{% endif %}>7 jours sur 7</option>
				  <option value="5/7" {% if offre_choisie.0.jours == "5/7" %}selected{% endif %}>5 jours sur 7</option>
	              <option value=""> </option>
	
				</select>
			</div>
		  </div>
      <div class="control-group">
      <label class="control-label">Type de forfait</label>
      	<div class="controls">
      		<label class="checkbox inline" for="fixe">
     			<input type="checkbox" id="fixe" name ="fixe" value="x" {% if offre_choisie.0.fixe == "x" %}checked{% endif %}> Fixe
 			</label>
			<label class="checkbox inline"for="mobile">
  				<input type="checkbox" id="mobile" name ="mobile" value="x" {% if offre_choisie.0.mobile == "x" %}checked{% endif %}> Mobile
			</label>
		</div>  
	  </div>
      
      <div class="control-group">
			<label class="control-label" for="pays">Pays</label>
			<div class="controls">
			   <select name="pays" size="1" />
	           	<option value="">Selectionnez...</option>
                {% for pays in pays %}
				<option value="{{pays.id}}" >{{pays.nom}}</option>
				{% endfor %}
				</select>
			</div>
		  </div>
          
{% else %}
    			<input name="temps_min" type="hidden" value=""/> 
                <input name="jours" type="hidden" value=""/> 
                <input name="horaires" type="hidden" value=""/> 
                <input name="fixe" type="hidden" value=""/> 
                <input name="mobile" type="hidden" value=""/> 
                <input name="pays" type="hidden" value=""/> 
{% endif %}
          
      <div class="control-group">
      <label class="control-label">Appels interne</label>
      	<div class="controls">
      		<label class="checkbox inline" for="interne">
     			<input type="checkbox" id="interne" name ="interne" value="x" {% if offre_choisie.0.interne == "x" %}checked{% endif %}> 
 			</label>
		</div>  
	  </div>	
     
     

        <div class="control-group">
            <label class="control-label" for="options_incluses">Options Incluses</label>
            <div class="controls">
            <input name="options_incluses" type="hidden" value="{{options_incluses}}"/> 
            {% for option in options %}
            	{{option}}<br>
            {% endfor %}
            </div>
        </div>
          
	</fieldset>

	</div>
	</div>
	
	
		<div class="form-actions">
		<span>Action après validation</span>
		<br/>
		  <select name="action">
			<option value="ve-offre-fixe">Afficher la liste </option>
			<!--<option value="">Créer une commande pour un client</a></option>-->
			<option value="ve-offre-fixe-creation">Saisir une nouvelle offre</option>
		  </select>
		<br/><br/>
         
		<button type="submit" class="btn btn-primary" name="creation">Création</button>
        <button type="reset" class="btn " name="annuler">Annuler</button>
        
		</div>

{% endif %}		
</form>

{% endblock %}
	
